home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / OpenGL 1.0 SDK / Source / Libraries / glut / glut_ext.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  1021 b   |  50 lines  |  [TEXT/CWIE]

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees
  5.    and is provided without guarantee or warrantee expressed or
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include <string.h>
  9.  
  10. #include "glut.h"
  11. #include "glutint.h"
  12.  
  13. int glutExtensionSupported(const char *extension)
  14. {
  15.     static const GLubyte *extensions = NULL;
  16.     const GLubyte *start;
  17.     GLubyte *where, *terminator;
  18.  
  19.     /* Extension names should not have spaces. */
  20.     where = (GLubyte *) strchr(extension, ' ');
  21.     if(where || *extension == '\0')
  22.     return 0;
  23.  
  24.     if(!extensions) extensions = glGetString(GL_EXTENSIONS);
  25.     
  26.     start = extensions;
  27.     for(;;)
  28.     {
  29.         where = (GLubyte *) strstr((const char *)start, extension);
  30.         if(!where) break;
  31.         
  32.         terminator = where + strlen(extension);
  33.         
  34.         if(where == start || *(where - 1) == ' ')
  35.         {
  36.             if(*terminator == ' ' || *terminator == '\0') return 1;
  37.         }
  38.         
  39.         start = terminator;
  40.     }
  41.     
  42.     return 0;
  43. }
  44.  
  45. int __glutIsSupportedByAGL(const char *extension)
  46. {
  47.     return 0;
  48. }
  49.  
  50.